package com.ajk.server.dao;
import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.UpdateProvider;

import com.ajk.server.dao.provider.FriendTreatmentPicProvider;
import com.ajk.server.model.FriendTreatmentPic;
import com.ajk.server.model.query.FriendTreatmentPicQuery;
/**
 * 亲友就诊图片  <br>
 * t_friend_treatment_pic <br>
 * v1.0 2016-05-01
 */
 public interface FriendTreatmentPicMapper {
 	
 	/**
 	*根据id删除 亲友就诊图片
 	*/
 	@Delete("delete from t_friend_treatment_pic where id=#{id}")
 	public Integer deleteById(Integer id);
 	
 	@DeleteProvider(method="deleteByIds",type=FriendTreatmentPicProvider.class)
 	public Integer deleteByIds(List<Integer> ids);
 	
 	/**
 	* 批量新增 亲友就诊图片
 	*/
 	@InsertProvider(method="batchInsert",type=FriendTreatmentPicProvider.class)
	@Options(useGeneratedKeys=true,keyColumn="id",keyProperty="list[0].id")
 	public Integer batchInsert(List<? extends FriendTreatmentPic> friendTreatmentPics);
 	
 	/**
 	* 新增 亲友就诊图片
 	*/
 	@InsertProvider(method="insert",type=FriendTreatmentPicProvider.class)
	@Options(useGeneratedKeys=true)
 	public Integer insert(FriendTreatmentPic domain);
 
 	
 	/**
 	*更新 亲友就诊图片
 	*/
 	@UpdateProvider(method="update",type=FriendTreatmentPicProvider.class)
 	public Integer update(FriendTreatmentPic domain);
 	
 	/**
 	*根据ID查询 亲友就诊图片
 	*/
	@Select("select * from t_friend_treatment_pic where id=#{id}")
	public FriendTreatmentPic findById(Integer id);
	
	/**
 	*通过query 查询 亲友就诊图片
 	*/
 	@SelectProvider(method="findByQuery",type=FriendTreatmentPicProvider.class)
 	public List<FriendTreatmentPic> findByQuery(FriendTreatmentPicQuery query);
 	
 	/**
 	*通过query count总条数
 	*/
 	@SelectProvider(method="countByQuery",type=FriendTreatmentPicProvider.class)
 	public Integer countByQuery(FriendTreatmentPicQuery query);
 	
 	/**
 	* 通过ids查询
 	*/
 	@SelectProvider(method="findByIds",type=FriendTreatmentPicProvider.class)
 	public List<FriendTreatmentPic> findByIds(List<Integer> ids);
 	
 	@SelectProvider(method="findByParentIds",type=FriendTreatmentPicProvider.class)
	public List<FriendTreatmentPic> findByParentIds(List<Integer> parentIds);
}	